<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="注册日期">
        <el-date-picker
          v-model="dateRange"
          style="width: 240px"
          value-format="yyyy-MM-dd HH:mm:ss"
          type="datetimerange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>

      <el-form-item label="注册电话" prop="phone" label-width="100px">
        <el-input
          v-model="queryParams.phone"
          placeholder="注册电话"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="注册邮箱" prop="eamil" label-width="100px">
        <el-input
          v-model="queryParams.eamil"
          placeholder="注册邮箱"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--      两下拉查询只需要传给后端id&code就行了-->
      <!--      这个下拉改成字典服务状态下拉-->
      <el-form-item label="状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="请选择" filterable popper-class="my-dropdown" clearable
                   :value-key="'code'">
          <el-option v-for="item in serviceStatusListSelectOptions" :key="item.code" :label="item.name"
                     :value="item.code"></el-option>
        </el-select>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <!--        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
        >新增
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="manageList" @selection-change="handleSelectionChange">
      <el-table-column label="操作" align="center" width="150">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row,'edit')"
          >修改
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row,'detail')"
          >详情
          </el-button>
        </template>
      </el-table-column>
      <el-table-column label="id" prop="auditingId" align="center" width="350"/>
      <el-table-column label="邮箱" prop="email" align="center" width="150"/>
      <el-table-column label="注册电话" prop="phone" align="center" width="150"/>
      <el-table-column label="昵称" prop="nickName" align="center" width="150"/>
      <el-table-column label="客户类型" prop="customerTypeName" align="center" width="150"/>
      <el-table-column label="国家地区" prop="registrationRegionName" align="center" width="150"/>
      <el-table-column label="注册渠道" prop="registerChannelName" align="center" width="150"/>
      <el-table-column label="状态" prop="statusName" align="center" width="150"/>
      <el-table-column label="实名时间" prop="realNameTime" align="center" width="150"/>
      <el-table-column label="注册时间" prop="createTime" align="center" width="150"/>
      <el-table-column label="描述" prop="description" align="center" width="350" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          {{ scope.row.description }}
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!--     添加或修改对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1020px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="200px">
        <span style="font-weight: bold; color: #333;position: relative;top: -15px;font-size: 15px;left: 41px;">基本信息
          <span
            style="position: absolute;display: inline-block; width: 1321%; border-bottom: 1px solid #ccc;margin-top: 9px;"></span></span>
        <!--       新增编辑部分-->
        <el-row v-if="showAddOrUpdateView">
          <el-row>
            <el-col :span="10">
              <el-form-item label="id" prop="registerId">
                <template #label>
                  <span style="color: red;">*</span>id
                </template>
                <el-select v-model="registerId" placeholder="请选择" filterable popper-class="my-dropdown"
                           :value-key="'code'">
                  <el-option v-for="item in registerIdSelectOptions" :key="item.code" :label="item.name"
                             :value="item"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="状态" prop="statusName">
                <el-input v-model="form.statusName" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="10">
              <el-form-item label="注册邮箱" prop="email">
                <el-input v-model="form.email" :disabled="true"/>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="注册电话" prop="phone">
                <el-input v-model="form.phone" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <span style="font-weight: bold; color: #333;position: relative;top: -15px;font-size: 15px;left: 41px;">基本信息
          <span
            style="position: absolute;display: inline-block; width: 1321%; border-bottom: 1px solid #ccc;margin-top: 9px;"></span></span>
          <el-row>
            <el-col :span="10">
              <el-form-item label="客户类型" prop="registerCustomerType">
                <template #label>
                  <span style="color: red;">*</span>客户类型
                </template>
                <el-select v-model="registerCustomerType" placeholder="请选择" filterable popper-class="my-dropdown"
                           :value-key="'code'">
                  <el-option v-for="item in registerCustomerTypeIdSelectOptions" :key="item.code" :label="item.name"
                             :value="item"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="注册地区" prop="registrationRegion">
                <template #label>
                  <span style="color: red;">*</span>注册地区
                </template>
                <el-select v-model="registrationRegion" placeholder="请选择" filterable popper-class="my-dropdown"
                           :value-key="'code'">
                  <el-option v-for="item in registrationRegionIdSelectOptions" :key="item.code" :label="item.name"
                             :value="item"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <!--          个人-->
          <el-row v-if="showCustomerTypePer">
            <el-row>
              <el-col :span="10">
                <el-form-item label="证件类型" prop="certificateType">
                  <template #label>
                    <span style="color: red;">*</span>证件类型
                  </template>
                  <el-select v-model="certificateType" placeholder="请选择" filterable popper-class="my-dropdown"
                             :value-key="'code'">
                    <el-option v-for="item in certificateTypeIdMainLandSelectOptions" :key="item.code"
                               :label="item.name"
                               :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="人像页" prop="certificatePer">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="certificatePerHandleSuccess"
                    :on-remove="certificatePerHandleRemove"
                    :before-upload="certificatePerBeforeUpload"
                    :file-list="certificatePerFile"
                    :headers="headers"
                    :limit="1"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>

              <el-col :span="10">
                <el-form-item :label="certificateTwoTextLabel" prop="certificateTwo">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="certificateTwoHandleSuccess"
                    :on-remove="certificateTwoHandleRemove"
                    :before-upload="certificateTwoBeforeUpload"
                    :file-list="certificateTwoFile"
                    :headers="headers"
                    :limit="1"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="姓名" prop="name">
                  <el-input v-model="form.name"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件号码" prop="certificateNumber">
                  <el-input v-model="form.certificateNumber"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="证件有效期(起)">
                  <el-date-picker
                    v-model="form.certificateStart"
                    type="date"
                    placeholder="选择证件有效期"
                    ref="startTimePicker"
                    clearable
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件有效期(止)">
                  <el-date-picker
                    v-model="form.certificateEnd"
                    type="date"
                    placeholder="选择证件有效期"
                    ref="startTimePicker"
                    clearable
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="出生日期">
                  <el-date-picker
                    v-model="form.birthtime"
                    type="date"
                    placeholder="选择出生日期"
                    ref="startTimePicker"
                    clearable
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
              <!--            showPassportNumber-->
              <el-col :span="10" v-if="showPassportNumber">
                <el-form-item label="通行证号码" prop="passportNumber">
                  <el-input v-model="form.passportNumber"/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="20">
                <el-form-item label="地址" prop="address">
                  <el-input v-model="form.address"/>
                </el-form-item>
              </el-col>
            </el-row>
            <span style="font-weight: bold; color: #333;position: relative;top: -15px;font-size: 15px;left: 41px;">更多信息
          <span
            style="position: absolute;display: inline-block; width: 1321%; border-bottom: 1px solid #ccc;margin-top: 9px;"></span></span>
            <el-row>
              <el-col :span="20">
                <el-form-item label="证明照片" prop="certificateTwo">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="moreCertificateHandleSuccess"
                    :on-remove="moreCertificateHandleRemove"
                    :before-upload="moreCertificateBeforeUpload"
                    :file-list="moreCertificateFile"
                    :headers="headers"
                    :limit="3"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-row>

          </el-row>
          <!--          企业-->
          <el-row v-if="showCustomerTypeCom">
            <el-row>
              <el-col :span="10">
                <el-form-item :label="businessLicenseTextLabel" prop="businessLicense">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="businessLicenseHandleSuccess"
                    :on-remove="businessLicenseHandleRemove"
                    :before-upload="businessLicenseBeforeUpload"
                    :file-list="businessLicenseFile"
                    :headers="headers"
                    :limit="1"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>

              <el-col :span="10">
                <el-form-item :label="creditCodeTextLabel" prop="creditCode">
                  <el-input v-model="form.creditCode"/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="20">
                <el-form-item label="名称" prop="enterpriseName">
                  <el-input v-model="form.enterpriseName"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="企业类型" prop="enterpriseType">
                  <el-input v-model="form.enterpriseType"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="法定代表人" prop="legalRepresentative">
                  <el-input v-model="form.legalRepresentative"/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <el-form-item label="成立日期">
                  <el-date-picker
                    v-model="form.incorporationTime"
                    type="date"
                    placeholder="选择成立日期"
                    ref="startTimePicker"
                    clearable
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="注册资本" prop="registeredCapital">
                  <el-input v-model="form.registeredCapital" type="number"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="营业期限(起)">
                  <el-date-picker
                    v-model="form.businessTermStart"
                    type="date"
                    placeholder="选择成立日期"
                    ref="startTimePicker"
                    clearable
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="营业期限(止)">
                  <el-date-picker
                    v-model="form.businessTermEnd"
                    type="date"
                    placeholder="选择成立日期"
                    ref="startTimePicker"
                    clearable
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="20">
                <el-form-item label="地址" prop="businessAddress">
                  <el-input v-model="form.businessAddress"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="20">
                <el-form-item label="经营范围" prop="businessScope">
                  <el-input v-model="form.businessScope"/>
                </el-form-item>
              </el-col>
            </el-row>
            <span style="font-weight: bold; color: #333;position: relative;top: -15px;font-size: 15px;left: 41px;">法人信息
          <span
            style="position: absolute;display: inline-block; width: 1321%; border-bottom: 1px solid #ccc;margin-top: 9px;"></span></span>

            <el-row>
              <el-col :span="10">
                <el-form-item label="证件类型" prop="comCertificateType">
                  <template #label>
                    <span style="color: red;">*</span>证件类型
                  </template>
                  <el-select v-model="comCertificateType" placeholder="请选择" filterable popper-class="my-dropdown"
                             :value-key="'code'">
                    <el-option v-for="item in comCertificateTypeIdSelectOptions" :key="item.code" :label="item.name"
                               :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <el-form-item label="人像页" prop="comCertificatePer">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="comCertificatePerHandleSuccess"
                    :on-remove="comCertificatePerHandleRemove"
                    :before-upload="comCertificatePerBeforeUpload"
                    :file-list="comCertificatePerFile"
                    :headers="headers"
                    :limit="1"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="国徽页" prop="comCertificateEmb">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="comCertificateEmbHandleSuccess"
                    :on-remove="comCertificateEmbHandleRemove"
                    :before-upload="comCertificateEmbeBeforeUpload"
                    :file-list="comCertificateEmbFile"
                    :headers="headers"
                    :limit="1"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="姓名" prop="legalName">
                  <el-input v-model="form.legalName"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件号码" prop="legalNumber">
                  <el-input v-model="form.legalNumber"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="证件有效期(起)">
                  <el-date-picker
                    v-model="form.legalCertificateStart"
                    type="date"
                    placeholder="选择证件有效期"
                    ref="startTimePicker"
                    clearable
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件有效期(止)">
                  <el-date-picker
                    v-model="form.legalCertificateEnd"
                    type="date"
                    placeholder="选择证件有效期"
                    ref="startTimePicker"
                    clearable
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="出生日期">
                  <el-date-picker
                    v-model="form.legalBirthTime"
                    type="date"
                    placeholder="选择出生日期"
                    ref="startTimePicker"
                    clearable
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="通行证号码" prop="legalPassportNumber">
                  <el-input v-model="form.legalPassportNumber"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="地址" prop="legalAddress">
                  <el-input v-model="form.legalAddress"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="股东①证件" prop="shareholderTypeOne">
                  <el-select v-model="shareholderTypeOne" placeholder="请选择" filterable popper-class="my-dropdown"
                             :value-key="'code'">
                    <el-option v-for="item in shareholderTypeOneIdSelectOptions" :key="item.code" :label="item.name"
                               :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <el-form-item label="股东①姓名" prop="shareholderNameOne">
                  <el-input v-model="form.shareholderNameOne"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件号码①" prop="shareholderNumberOne">
                  <el-input v-model="form.shareholderNumberOne"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="股东②证件" prop="shareholderTypeTwo">
                  <el-select v-model="shareholderTypeTwo" placeholder="请选择" filterable popper-class="my-dropdown"
                             :value-key="'code'">
                    <el-option v-for="item in shareholderTypeTwoIdSelectOptions" :key="item.code" :label="item.name"
                               :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <el-form-item label="股东②姓名" prop="shareholderNameTwo">
                  <el-input v-model="form.shareholderNameTwo"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件号码②" prop="shareholderNumberTwo">
                  <el-input v-model="form.shareholderNumberTwo"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="股东③证件" prop="shareholderTypeThree">
                  <el-select v-model="shareholderTypeThree" placeholder="请选择" filterable popper-class="my-dropdown"
                             :value-key="'code'">
                    <el-option v-for="item in shareholderTypeThreeIdSelectOptions" :key="item.code" :label="item.name"
                               :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <el-form-item label="股东③姓名" prop="shareholderNameThree">
                  <el-input v-model="form.shareholderNameThree"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件号码③" prop="shareholderNumberThree">
                  <el-input v-model="form.shareholderNumberThree"/>
                </el-form-item>
              </el-col>
            </el-row>

            <span style="font-weight: bold; color: #333;position: relative;top: -15px;font-size: 15px;left: 41px;">更多信息
          <span
            style="position: absolute;display: inline-block; width: 1321%; border-bottom: 1px solid #ccc;margin-top: 9px;"></span></span>

            <el-row>
              <el-col :span="10">
                <el-form-item label="证明类型" prop="proveType">
                  <el-select v-model="proveType" placeholder="请选择" filterable popper-class="my-dropdown"
                             :value-key="'code'">
                    <el-option v-for="item in proveTypeIdSelectOptions" :key="item.code" :label="item.name"
                               :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="20">
                <el-form-item label="证明照片" prop="proveImage">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="proveImageHandleSuccess"
                    :on-remove="proveImageHandleRemove"
                    :before-upload="proveImageBeforeUpload"
                    :file-list="proveImageFile"
                    :headers="headers"
                    :limit="1"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="证明编号" prop="proveNumber">
                  <el-input v-model="form.proveNumber"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="登记日期">
                  <el-date-picker
                    v-model="form.registrationTime"
                    type="date"
                    placeholder="选择登记日期"
                    ref="startTimePicker"
                    clearable
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
            </el-row>

            <span style="font-weight: bold; color: #333;position: relative;top: -15px;font-size: 15px;left: 41px;">代理人信息
          <span
            style="position: absolute;display: inline-block; width: 1051%; border-bottom: 1px solid #ccc;margin-top: 9px;"></span></span>

            <el-row>
              <el-col :span="10">
                <el-form-item label="证明类型" prop="agentType">
                  <el-select v-model="agentType" placeholder="请选择" filterable popper-class="my-dropdown"
                             :value-key="'code'">
                    <el-option v-for="item in agentTypeIdSelectOptions" :key="item.code" :label="item.name"
                               :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="人像页" prop="agentPerFile">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="agentPerFileHandleSuccess"
                    :on-remove="agentPerFileHandleRemove"
                    :before-upload="agentPerFileBeforeUpload"
                    :file-list="agentPerFile"
                    :headers="headers"
                    :limit="1"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="国徽页" prop="agentEmbFile">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="agentEmbFileHandleSuccess"
                    :on-remove="agentEmbFileHandleRemove"
                    :before-upload="agentEmbFileBeforeUpload"
                    :file-list="agentEmbFile"
                    :headers="headers"
                    :limit="1"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="姓名" prop="agentName">
                  <el-input v-model="form.agentName"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件号码" prop="agentNumber">
                  <el-input v-model="form.agentNumber"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="证件有效期(起)">
                  <el-date-picker
                    v-model="form.agentStart"
                    type="date"
                    placeholder="选择证件有效期"
                    ref="startTimePicker"
                    clearable
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件有效期(止)">
                  <el-date-picker
                    v-model="form.agentEnd"
                    type="date"
                    placeholder="选择证件有效期"
                    ref="startTimePicker"
                    clearable
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="授权文件" prop="authorizationFile">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/uploadFile/"
                    :on-success="authorizationFileHandleSuccess"
                    :on-remove="authorizationFileHandleRemove"
                    :before-upload="authorizationFileBeforeUpload"
                    :file-list="authorizationFile"
                    :headers="headers"
                    :limit="1"
                    list-type="text"
                    accept=".pdf"
                    show-file-list
                  >
                    <i class="el-icon-plus"></i>
<!--                    手动点击下载，存疑-->
<!--                    <div slot="file" slot-scope="{ file }">-->
<!--                      <a @click.prevent="handleFileClick(file)">{{ file.name }}</a>-->
<!--                    </div>-->
                  </el-upload>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="" >
                  <el-button type="primary" @click="moduleFileClick">模板下载</el-button>
                </el-form-item>
              </el-col>
            </el-row>

          </el-row>
        </el-row>
        <!--        详情部分-->
        <el-row v-if="showDetailView">
          <el-row>
            <el-col :span="10">
              <el-form-item label="id" prop="registerId">
                <template #label>
                  <span style="color: red;">*</span>id
                </template>
                <el-select v-model="registerId" placeholder="请选择" filterable popper-class="my-dropdown"
                           :value-key="'code'" :disabled="true">
                  <el-option v-for="item in registerIdSelectOptions" :key="item.code" :label="item.name"
                             :value="item"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="状态" prop="statusName">
                <el-input v-model="form.statusName" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="10">
              <el-form-item label="注册邮箱" prop="email">
                <el-input v-model="form.email" :disabled="true"/>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="注册电话" prop="phone">
                <el-input v-model="form.phone" :disabled="true"/>
              </el-form-item>
            </el-col>
          </el-row>

          <span style="font-weight: bold; color: #333;position: relative;top: -15px;font-size: 15px;left: 41px;">基本信息
          <span
            style="position: absolute;display: inline-block; width: 1321%; border-bottom: 1px solid #ccc;margin-top: 9px;"></span></span>
          <el-row>
            <el-col :span="10">
              <el-form-item label="客户类型" prop="registerCustomerType">
                <template #label>
                  <span style="color: red;">*</span>客户类型
                </template>
                <el-select v-model="registerCustomerType" placeholder="请选择" filterable popper-class="my-dropdown"
                           :value-key="'code'" :disabled="true">
                  <el-option v-for="item in registerCustomerTypeIdSelectOptions" :key="item.code" :label="item.name"
                             :value="item"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="注册地区" prop="registrationRegion">
                <template #label>
                  <span style="color: red;">*</span>注册地区
                </template>
                <el-select v-model="registrationRegion" placeholder="请选择" filterable popper-class="my-dropdown"
                           :value-key="'code'" :disabled="true">
                  <el-option v-for="item in registrationRegionIdSelectOptions" :key="item.code" :label="item.name"
                             :value="item"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <!--          个人-->
          <el-row v-if="showCustomerTypePer">
            <el-row>
              <el-col :span="10">
                <el-form-item label="证件类型" prop="certificateType">
                  <template #label>
                    <span style="color: red;">*</span>证件类型
                  </template>
                  <el-select v-model="certificateType" placeholder="请选择" filterable popper-class="my-dropdown"
                             :value-key="'code'" :disabled="true">
                    <el-option v-for="item in certificateTypeIdMainLandSelectOptions" :key="item.code"
                               :label="item.name"
                               :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="人像页" prop="certificatePer">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="certificatePerHandleSuccess"
                    :on-remove="certificatePerHandleRemove"
                    :before-upload="certificatePerBeforeUpload"
                    :file-list="certificatePerFile"
                    :headers="headers"
                    :limit="1"
                    :disabled="true"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>

              <el-col :span="10">
                <el-form-item :label="certificateTwoTextLabel" prop="certificateTwo">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="certificateTwoHandleSuccess"
                    :on-remove="certificateTwoHandleRemove"
                    :before-upload="certificateTwoBeforeUpload"
                    :file-list="certificateTwoFile"
                    :headers="headers"
                    :limit="1"
                    :disabled="true"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="姓名" prop="name">
                  <el-input v-model="form.name" :disabled="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件号码" prop="certificateNumber">
                  <el-input v-model="form.certificateNumber" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="证件有效期(起)">
                  <el-date-picker
                    v-model="form.certificateStart"
                    type="date"
                    placeholder="选择证件有效期"
                    ref="startTimePicker"
                    clearable
                    :disabled="true"
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件有效期(止)">
                  <el-date-picker
                    v-model="form.certificateEnd"
                    type="date"
                    placeholder="选择证件有效期"
                    ref="startTimePicker"
                    clearable
                    :disabled="true"
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="出生日期">
                  <el-date-picker
                    v-model="form.birthtime"
                    type="date"
                    placeholder="选择出生日期"
                    ref="startTimePicker"
                    clearable
                    :disabled="true"
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
              <!--            showPassportNumber-->
              <el-col :span="10" v-if="showPassportNumber">
                <el-form-item label="通行证号码" prop="passportNumber">
                  <el-input v-model="form.passportNumber" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="20">
                <el-form-item label="地址" prop="address">
                  <el-input v-model="form.address" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>
            <span style="font-weight: bold; color: #333;position: relative;top: -15px;font-size: 15px;left: 41px;">更多信息
          <span
            style="position: absolute;display: inline-block; width: 1321%; border-bottom: 1px solid #ccc;margin-top: 9px;"></span></span>
            <el-row>
              <el-col :span="20">
                <el-form-item label="证明照片" prop="certificateTwo">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="moreCertificateHandleSuccess"
                    :on-remove="moreCertificateHandleRemove"
                    :before-upload="moreCertificateBeforeUpload"
                    :file-list="moreCertificateFile"
                    :headers="headers"
                    :disabled="true"
                    :limit="3"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-row>

          </el-row>
          <!--          企业-->
          <el-row v-if="showCustomerTypeCom">
            <el-row>
              <el-col :span="10">
                <el-form-item :label="businessLicenseTextLabel" prop="businessLicense">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="businessLicenseHandleSuccess"
                    :on-remove="businessLicenseHandleRemove"
                    :before-upload="businessLicenseBeforeUpload"
                    :file-list="businessLicenseFile"
                    :headers="headers"
                    :limit="1"
                    list-type="picture-card"
                    :disabled="true"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>

              <el-col :span="10">
                <el-form-item :label="creditCodeTextLabel" prop="creditCode">
                  <el-input v-model="formView.creditCode" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="20">
                <el-form-item label="名称" prop="enterpriseName">
                  <el-input v-model="formView.enterpriseName" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="企业类型" prop="enterpriseType">
                  <el-input v-model="formView.enterpriseType" :disabled="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="法定代表人" prop="legalRepresentative">
                  <el-input v-model="formView.legalRepresentative" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <el-form-item label="成立日期">
                  <el-date-picker
                    v-model="form.incorporationTime"
                    type="date"
                    placeholder="选择成立日期"
                    ref="startTimePicker"
                    clearable
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                    :disabled="true"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="注册资本" prop="registeredCapital">
                  <el-input v-model="formView.registeredCapital" type="number" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="营业期限(起)">
                  <el-date-picker
                    v-model="formView.businessTermStart"
                    type="date"
                    placeholder="选择成立日期"
                    ref="startTimePicker"
                    clearable
                    :disabled="true"
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="营业期限(止)">
                  <el-date-picker
                    v-model="formView.businessTermEnd"
                    type="date"
                    placeholder="选择成立日期"
                    ref="startTimePicker"
                    clearable
                    :disabled="true"
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="20">
                <el-form-item label="地址" prop="businessAddress">
                  <el-input v-model="formView.businessAddress" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="20">
                <el-form-item label="经营范围" prop="businessScope">
                  <el-input v-model="formView.businessScope" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>
            <span style="font-weight: bold; color: #333;position: relative;top: -15px;font-size: 15px;left: 41px;">法人信息
          <span
            style="position: absolute;display: inline-block; width: 1321%; border-bottom: 1px solid #ccc;margin-top: 9px;"></span></span>

            <el-row>
              <el-col :span="10">
                <el-form-item label="证件类型" prop="comCertificateType">
                  <el-select v-model="comCertificateType" placeholder="请选择" filterable popper-class="my-dropdown"
                             :value-key="'code'" :disabled="true">
                    <el-option v-for="item in comCertificateTypeIdSelectOptions" :key="item.code" :label="item.name"
                               :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <el-form-item label="人像页" prop="comCertificatePer">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="comCertificatePerHandleSuccess"
                    :on-remove="comCertificatePerHandleRemove"
                    :before-upload="comCertificatePerBeforeUpload"
                    :file-list="comCertificatePerFile"
                    :headers="headers"
                    :limit="1"
                    :disabled="true"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="国徽页" prop="comCertificateEmb">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="comCertificateEmbHandleSuccess"
                    :on-remove="comCertificateEmbHandleRemove"
                    :before-upload="comCertificateEmbeBeforeUpload"
                    :file-list="comCertificateEmbFile"
                    :headers="headers"
                    :limit="1"
                    :disabled="true"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="姓名" prop="legalName">
                  <el-input v-model="formView.legalName" :disabled="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件号码" prop="legalNumber">
                  <el-input v-model="formView.legalNumber" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="证件有效期(起)">
                  <el-date-picker
                    v-model="formView.legalCertificateStart"
                    type="date"
                    placeholder="选择证件有效期"
                    ref="startTimePicker"
                    clearable
                    :disabled="true"
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件有效期(止)">
                  <el-date-picker
                    v-model="formView.legalCertificateEnd"
                    type="date"
                    placeholder="选择证件有效期"
                    ref="startTimePicker"
                    clearable
                    :disabled="true"
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="出生日期">
                  <el-date-picker
                    v-model="formView.legalBirthTime"
                    type="date"
                    placeholder="选择出生日期"
                    ref="startTimePicker"
                    clearable
                    :disabled="true"
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="通行证号码" prop="legalPassportNumber">
                  <el-input v-model="formView.legalPassportNumber" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="地址" prop="legalAddress">
                  <el-input v-model="formView.legalAddress" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="股东①证件" prop="shareholderTypeOne">
                  <el-select v-model="shareholderTypeOne" placeholder="请选择" filterable popper-class="my-dropdown"
                             :value-key="'code'" :disabled="true">
                    <el-option v-for="item in shareholderTypeOneIdSelectOptions" :key="item.code" :label="item.name"
                               :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <el-form-item label="股东①姓名" prop="shareholderNameOne">
                  <el-input v-model="formView.shareholderNameOne" :disabled="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件号码①" prop="shareholderNumberOne">
                  <el-input v-model="formView.shareholderNumberOne" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="股东②证件" prop="shareholderTypeTwo">
                  <el-select v-model="shareholderTypeTwo" placeholder="请选择" filterable popper-class="my-dropdown"
                             :value-key="'code'" :disabled="true">
                    <el-option v-for="item in shareholderTypeTwoIdSelectOptions" :key="item.code" :label="item.name"
                               :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <el-form-item label="股东②姓名" prop="shareholderNameTwo">
                  <el-input v-model="formView.shareholderNameTwo" :disabled="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件号码②" prop="shareholderNumberTwo">
                  <el-input v-model="formView.shareholderNumberTwo" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="股东③证件" prop="shareholderTypeThree">
                  <el-select v-model="shareholderTypeThree" placeholder="请选择" filterable popper-class="my-dropdown"
                             :value-key="'code'" :disabled="true">
                    <el-option v-for="item in shareholderTypeThreeIdSelectOptions" :key="item.code" :label="item.name"
                               :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <el-form-item label="股东③姓名" prop="shareholderNameThree">
                  <el-input v-model="formView.shareholderNameThree" :disabled="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件号码③" prop="shareholderNumberThree">
                  <el-input v-model="formView.shareholderNumberThree" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>

            <span style="font-weight: bold; color: #333;position: relative;top: -15px;font-size: 15px;left: 41px;">更多信息
          <span
            style="position: absolute;display: inline-block; width: 1321%; border-bottom: 1px solid #ccc;margin-top: 9px;"></span></span>

            <el-row>
              <el-col :span="10">
                <el-form-item label="证明类型" prop="proveType">
                  <el-select v-model="proveType" placeholder="请选择" filterable popper-class="my-dropdown"
                             :value-key="'code'" :disabled="true">
                    <el-option v-for="item in proveTypeIdSelectOptions" :key="item.code" :label="item.name"
                               :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="20">
                <el-form-item label="证明照片" prop="proveImage">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="proveImageHandleSuccess"
                    :on-remove="proveImageHandleRemove"
                    :before-upload="proveImageBeforeUpload"
                    :file-list="proveImageFile"
                    :headers="headers"
                    :limit="1"
                    :disabled="true"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="证明编号" prop="proveNumber">
                  <el-input v-model="formView.proveNumber" :disabled="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="登记日期">
                  <el-date-picker
                    v-model="formView.registrationTime"
                    type="date"
                    placeholder="选择登记日期"
                    ref="startTimePicker"
                    clearable
                    :disabled="true"
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
            </el-row>

            <span style="font-weight: bold; color: #333;position: relative;top: -15px;font-size: 15px;left: 41px;">代理人信息
          <span
            style="position: absolute;display: inline-block; width: 1051%; border-bottom: 1px solid #ccc;margin-top: 9px;"></span></span>

            <el-row>
              <el-col :span="10">
                <el-form-item label="证明类型" prop="agentType">
                  <el-select v-model="agentType" placeholder="请选择" filterable popper-class="my-dropdown"
                             :value-key="'code'" :disabled="true">
                    <el-option v-for="item in agentTypeIdSelectOptions" :key="item.code" :label="item.name"
                               :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="人像页" prop="agentPerFile">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="agentPerFileHandleSuccess"
                    :on-remove="agentPerFileHandleRemove"
                    :before-upload="agentPerFileBeforeUpload"
                    :file-list="agentPerFile"
                    :headers="headers"
                    :limit="1"
                    :disabled="true"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="国徽页" prop="agentEmbFile">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/upload/"
                    :on-success="agentEmbFileHandleSuccess"
                    :on-remove="agentEmbFileHandleRemove"
                    :before-upload="agentEmbFileBeforeUpload"
                    :file-list="agentEmbFile"
                    :headers="headers"
                    :limit="1"
                    :disabled="true"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="姓名" prop="agentName">
                  <el-input v-model="formView.agentName" :disabled="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件号码" prop="agentNumber">
                  <el-input v-model="formView.agentNumber" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="10">
                <el-form-item label="证件有效期(起)">
                  <el-date-picker
                    v-model="formView.agentStart"
                    type="date"
                    placeholder="选择证件有效期"
                    ref="startTimePicker"
                    clearable
                    :disabled="true"
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="10">
                <el-form-item label="证件有效期(止)">
                  <el-date-picker
                    v-model="formView.agentEnd"
                    type="date"
                    placeholder="选择证件有效期"
                    ref="startTimePicker"
                    clearable
                    :disabled="true"
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                  />
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="20">
                <el-form-item label="授权文件" prop="authorizationFile">
                  <el-upload
                    class="upload-file-uploader"
                    action="/dev-api/file/uploadFile/"
                    :on-success="authorizationFileHandleSuccess"
                    :on-remove="authorizationFileHandleRemove"
                    :before-upload="authorizationFileBeforeUpload"
                    :file-list="authorizationFile"
                    :headers="headers"
                    :limit="1"
                    :disabled="true"
                    list-type="picture-card"
                  >
                    <i class="el-icon-plus"></i>
                  </el-upload>
                </el-form-item>
              </el-col>

            </el-row>

          </el-row>
        </el-row>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm" v-if="showBtn">确 定</el-button>
        <el-button @click="cancel">关 闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {listCustomer, getCustomer, addCustomer, updateCustomer, editStatus} from "@/api/system/registerCustomerAud";
import {getUnique} from "@/api/system/uniqueValue";
import {getRegisterCustomerRegisterId, getServiceStatusSelect} from "@/api/system/selectList";
import {getRegisterCustomerRegisterIdById} from "@/api/system/serviceId";
import {addDateRange2} from "@/utils/ruoyi";
import {getToken} from "@/utils/auth";


export default {
  name: "National",
  data() {
    return {
      headers: {
        Authorization: "Bearer " + getToken()
      },
      //下拉选项
      //模态框归属国家的下拉
      modifyMessage: '',
      //列表搜索框服务状态下拉
      serviceStatusListSelectOptions: [],
      //列表搜索框国家的下拉
      nationalIdListSelectOptions: [],
      //模态框注册电话国际号码下拉
      phoneArea: [],
      phoneAreaSelectOptions: [],
      //注册渠道下拉
      registerChannel: [],
      registerChannelSelectOptions: [],
      //客户注册id下拉
      registerId: [],
      registerIdSelectOptions: [],
      //客户类型-个人-企业显示条件
      showCustomerTypePer: true,
      showCustomerTypeCom: true,
      //模态框 客户类型下拉
      registerCustomerType: [],
      registerCustomerTypeIdSelectOptions: [],
      //模态框 注册地区下拉
      registrationRegion: [],
      registrationRegionIdSelectOptions: [],
      //模态框 个人-证件类型下拉-中国大陆,
      //模态框 个人-证件类型下拉-中国香港
      certificateType: [],
      certificateTypeIdMainLandSelectOptions: [],
      //模态框 国徽页/手持证件照 label
      certificateTwoTextLabel: '国徽页',
      //模态框 个人,人像页，国徽页数组 img
      certificatePerFile: [],
      certificateTwoFile: [],
      //模态框 个人 证明照片
      moreCertificateFile: [],
      //模态框 个人-中国-通行证号码显示条件
      showPassportNumber: true,
      //模态框 企业-营业执照/商业登记证 and 统一信用代码/登记证号码 label
      businessLicenseTextLabel: '营业执照',
      creditCodeTextLabel: '统一信用代码',
      //模态框 企业-营业执照/商业登记证 img
      businessLicenseFile: [],
      //模态框 企业-法人信息-证件类型
      comCertificateType: [],
      comCertificateTypeIdSelectOptions: [],
      //模态框  企业-法人信息-人像页/国徽页
      comCertificatePerFile: [],
      comCertificateEmbFile: [],
      //模态框 股东证件1,2,3
      shareholderTypeOne: [],
      shareholderTypeOneIdSelectOptions: [],
      shareholderTypeTwo: [],
      shareholderTypeTwoIdSelectOptions: [],
      shareholderTypeThree: [],
      shareholderTypeThreeIdSelectOptions: [],
      //模态框 更多证明-企业-证明类型
      proveType: [],
      proveTypeIdSelectOptions: [],
      //模态框 证明照片
      proveImageFile: [],
      //模态框 代理人证件类型-企业
      agentType: [],
      agentTypeIdSelectOptions: [],
      //模态框 代理人 人像页/国徽页
      agentPerFile: [],
      agentEmbFile: [],
      //模态框 代理人 授权文件
      authorizationFile: [],
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      //显示条件
      showBtn: true,
      showModifyTime: true,
      showModifyByName: true,
      showModifyDescription: true,
      showModifyMsg: true,
      showCreateTime: true,
      showCreateByName: true,
      isWatching: true,
      // 非多个禁用
      multiple: true,
      showAddOrUpdateView: true,
      showDetailView: true,
      // 显示搜索条件
      showSearch: true,
      dateRange: [],
      dateRange2: [],
      // 总条数
      total: 0,
      // 公告表格数据
      manageList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        name: undefined,
        nickname: undefined,
        channel: undefined
      },
      // 表单参数
      form: {},
      formView: {},
      // 表单校验
      rules: {
        providersName: [
          {required: true, message: "服务商名称不能为空", trigger: "blur"}
        ]
      }
    };
  },
  created() {
    this.getList();
  },
  watch: {
    //这里做下拉切换值操作
    registerId(newValue, oldValue) {
      if (this.isWatching) {
        if (this.registerId != null && this.registerId.code != null) {
          getRegisterCustomerRegisterIdById(this.registerId.code).then(response => {
            this.form.phone = response.data.phone;
            this.form.email = response.data.email;
            this.form.statusName = response.data.statusName;
          });
        }
      }
    },
    registerCustomerType(newValue, oldValue) {
      //0企业 ，1个人
      if (this.isWatching) {
        //回显之外的情况 下拉
        this.registrationRegion = [];
        this.registerRegionEmpty();
        this.registerChange();
      } else {
        //回显则不清空
        this.registerChange();
      }
    },
    registrationRegion(newValue, oldValue) {
      //0中国大陆，1中国香港
      if (this.isWatching) {
        this.registerRegionEmpty();
        this.registerRegionChange();
      }else{
        this.registerRegionChange();
      }

    }

  },
  methods: {
    registerRegionEmpty(){
      this.certificateType = [];
      this.comCertificateType = [];
      this.shareholderTypeOne = [];
      this.shareholderTypeTwo = [];
      this.shareholderTypeThree = [];
      this.proveType = [];
      this.agentType = [];
      //所有图片清空
      this.certificatePerFile = [];
      this.certificateTwoFile = [];
      this.moreCertificateFile = [];
      this.businessLicenseFile = [];
      this.comCertificatePerFile = [];
      this.comCertificateEmbFile = [];
      this.proveImageFile = [];
      this.agentPerFile = [];
      this.agentEmbFile = [];
      this.authorizationFile = [];
      this.form.name = '';
      this.form.certificateNumber = '';
      this.form.passportNumber = '';
      this.form.address = '';
      this.form.creditCode = '';
      this.form.enterpriseName = '';
      this.form.enterpriseType = '';
      this.form.legalRepresentative = '';
      this.form.registeredCapital = '';
      this.form.businessAddress = '';
      this.form.businessScope = '';
      this.form.legalName = '';
      this.form.legalNumber = '';
      this.form.legalPassportNumber = '';
      this.form.legalAddress = '';
      this.form.shareholderNameOne = '';
      this.form.shareholderNumberOne = '';
      this.form.shareholderNameTwo = '';
      this.form.shareholderNumberTwo = '';
      this.form.shareholderNameThree = '';
      this.form.shareholderNumberThree = '';
      this.form.proveNumber = '';
      this.form.agentName = '';
      this.form.agentNumber = '';
      this.form.certificateStart = '';
      this.form.certificateEnd = '';
      this.form.birthtime = '';
      this.form.incorporationTime = '';
      this.form.businessTermStart = '';
      this.form.businessTermEnd = '';
      this.form.legalCertificateStart = '';
      this.form.legalCertificateEnd = '';
      this.form.legalBirthTime = '';
      this.form.registrationTime = '';
      this.form.agentStart = '';
      this.form.agentEnd = '';
    },
    registerRegionChange() {
      if (this.registrationRegion != null && this.registrationRegion.code != null) {
        if (this.registrationRegion.code == '0' || this.registrationRegion.code == 0) {
          this.certificateTwoTextLabel = '国徽页';
          this.showPassportNumber = true;
          this.businessLicenseTextLabel = '营业执照';
          this.creditCodeTextLabel = '统一信用代码';
          //TODO 过滤
          //个人过滤
          getServiceStatusSelect('REGISTER_CUSTOMERS_CERTIFICATE_TYPE_MAINLAND').then(response => {
            this.certificateTypeIdMainLandSelectOptions = response.data;
            var certificateTypeIdMainLandFilter = this.certificateTypeIdMainLandSelectOptions.filter(item => item.code != '2' && item.code != 2 && item.code != '3' && item.code != 3);//去掉code=0(无)
            this.certificateTypeIdMainLandSelectOptions = certificateTypeIdMainLandFilter;
          });
          //-------------------------------

          //企业过滤
          //comCertificateTypeIdSelectOptions  法人信息-证件类型 REGISTER_CUSTOMERS_CERTIFICATE_TYPE_COM
          //agentTypeIdSelectOptions  代理人信息-证明类型   REGISTER_CUSTOMERS_CERTIFICATE_TYPE_COM
          //proveTypeIdSelectOptions  更多信息-证明类型 REGISTER_CUSTOMERS_CERTIFICATE_TYPE_PROVE_TYPE
          getServiceStatusSelect('REGISTER_CUSTOMERS_CERTIFICATE_TYPE_COM').then(response => {
            this.comCertificateTypeIdSelectOptions = response.data;
            this.agentTypeIdSelectOptions = response.data;
          });
          //proveTypeIdSelectOptions
          getServiceStatusSelect('REGISTER_CUSTOMERS_CERTIFICATE_TYPE_PROVE_TYPE').then(response => {
            this.proveTypeIdSelectOptions = response.data;
            var proveTypeIdSelectOptionsFilter = this.proveTypeIdSelectOptions.filter(item => item.code != '1' && item.code != 1);//去掉code=0(无)
            this.proveTypeIdSelectOptions = proveTypeIdSelectOptionsFilter;
          });

        } else {
          //disable
          this.showPassportNumber = false;
          this.certificateTwoTextLabel = '手持证件照';
          this.businessLicenseTextLabel = '商业登记证';
          this.creditCodeTextLabel = '登记证号码';
          //TODO 过滤
          //个人过滤
          getServiceStatusSelect('REGISTER_CUSTOMERS_CERTIFICATE_TYPE_MAINLAND').then(response => {
            this.certificateTypeIdMainLandSelectOptions = response.data;
            var certificateTypeIdMainLandFilter = this.certificateTypeIdMainLandSelectOptions.filter(item => item.code != '0' && item.code != 0 && item.code != '1' && item.code != 1);//去掉code=0(无)
            this.certificateTypeIdMainLandSelectOptions = certificateTypeIdMainLandFilter;
          });
          //-------------------------------

          //企业过滤
          getServiceStatusSelect('REGISTER_CUSTOMERS_CERTIFICATE_TYPE_COM').then(response => {
            this.agentTypeIdSelectOptions = response.data;
            var agentTypeIdSelectOptionsFilter = this.agentTypeIdSelectOptions.filter(item => item.code != '0' && item.code != 0 && item.code != '1' && item.code != 1);//去掉code=0(无)
            this.agentTypeIdSelectOptions = agentTypeIdSelectOptionsFilter;
          });

          var comCertificateTypeIdSelectOptionsFilter = this.comCertificateTypeIdSelectOptions.filter(item => item.code != '1' && item.code != 1);//去掉code=0(无)
          this.comCertificateTypeIdSelectOptions = comCertificateTypeIdSelectOptionsFilter;

          //proveTypeIdSelectOptions
          getServiceStatusSelect('REGISTER_CUSTOMERS_CERTIFICATE_TYPE_PROVE_TYPE').then(response => {
            this.proveTypeIdSelectOptions = response.data;
            var proveTypeIdSelectOptionsFilter = this.proveTypeIdSelectOptions.filter(item => item.code != '0' && item.code != 0);//去掉code=0(无)
            this.proveTypeIdSelectOptions = proveTypeIdSelectOptionsFilter;
          });
        }
      }
    },
    registerChange() {
      if (this.registerCustomerType != null && this.registerCustomerType.code != null) {
        if (this.registerCustomerType.code == '0' || this.registerCustomerType.code == 0) {
          this.showCustomerTypeCom = true;
          this.showCustomerTypePer = false;
        } else {
          this.showCustomerTypeCom = false;
          this.showCustomerTypePer = true;
        }
      }
    },
    handleFileClick(file) {
      console.log("File clicked:", file);
      //TODO 下载 在这里添加点击文件后的处理逻辑
      this.$download.saveAs(file.url, file.name);
    },
    moduleFileClick(){
      getServiceStatusSelect('REGISTER_CUSTOMERS_TEMPLATE_DOWNLOAD').then(response => {
       var url= response.data[0].name;
       var name= response.data[0].code;
        this.$download.saveAs(url,name);
      });
    },
    authorizationFileHandleSuccess(response, file, fileList) {


      // this.authorizationFile.push({url: response.data});
      //
      // this.form.authorizationFile = this.authorizationFile.map(item => item.url).join(',');

      // 上传成功的回调
      this.authorizationFile = fileList.map(fileItem => ({
        name: fileItem.name || fileItem.raw.name,
        url: response.data ,
        uid: fileItem.uid
      }));
      console.log("this.authorizationFile=",this.authorizationFile);
      this.form.authorizationFile = this.authorizationFile.map(fileItem => fileItem.url).join(',');
      console.log("this.authorizationFile=",this.form.authorizationFile);

    },
    authorizationFileHandleRemove(file, farenFileList) {
      // 文件移除时的回调
      const index = this.authorizationFile.findIndex(item => item.url === file.url);
      if (index !== -1) {
        this.authorizationFile.splice(index, 1);
      }
      this.form.authorizationFile = this.authorizationFile.map(item => item.url).join(',');
    },
    authorizationFileBeforeUpload(file) {
      // 在上传前的钩子，可以在这里添加一些判断逻辑
      // 返回 false 可取消上传
      const isPDF = file.type === 'application/pdf';
      if (!isPDF) {
        this.$message.error('上传文件必须是 PDF 格式!');
      }
      return isPDF;
    },

    agentEmbFileHandleSuccess(response, file, farenFileList) {
      // 上传成功的回调
      this.agentEmbFile.push({url: response.data});

      this.form.agentEmb = this.agentEmbFile.map(item => item.url).join(',');
    },
    agentEmbFileHandleRemove(file, farenFileList) {
      // 文件移除时的回调
      const index = this.agentEmbFile.findIndex(item => item.url === file.url);
      if (index !== -1) {
        this.agentEmbFile.splice(index, 1);
      }
      this.form.agentEmb = this.agentEmbFile.map(item => item.url).join(',');
    },
    agentEmbFileBeforeUpload(file) {
      // 在上传前的钩子，可以在这里添加一些判断逻辑
      // 返回 false 可取消上传
      return true;
    },


    agentPerFileHandleSuccess(response, file, farenFileList) {
      // 上传成功的回调
      this.agentPerFile.push({url: response.data});

      this.form.agentPer = this.agentPerFile.map(item => item.url).join(',');
    },
    agentPerFileHandleRemove(file, farenFileList) {
      // 文件移除时的回调
      const index = this.agentPerFile.findIndex(item => item.url === file.url);
      if (index !== -1) {
        this.agentPerFile.splice(index, 1);
      }
      this.form.agentPer = this.agentPerFile.map(item => item.url).join(',');
    },
    agentPerFileBeforeUpload(file) {
      // 在上传前的钩子，可以在这里添加一些判断逻辑
      // 返回 false 可取消上传
      return true;
    },


    proveImageHandleSuccess(response, file, farenFileList) {
      // 上传成功的回调
      this.proveImageFile.push({url: response.data});

      this.form.proveImage = this.proveImageFile.map(item => item.url).join(',');
    },
    proveImageHandleRemove(file, farenFileList) {
      // 文件移除时的回调
      const index = this.proveImageFile.findIndex(item => item.url === file.url);
      if (index !== -1) {
        this.proveImageFile.splice(index, 1);
      }
      this.form.proveImage = this.proveImageFile.map(item => item.url).join(',');
    },
    proveImageBeforeUpload(file) {
      // 在上传前的钩子，可以在这里添加一些判断逻辑
      // 返回 false 可取消上传
      return true;
    },

    comCertificatePerHandleSuccess(response, file, farenFileList) {
      // 上传成功的回调
      this.comCertificatePerFile.push({url: response.data});

      this.form.comCertificatePer = this.comCertificatePerFile.map(item => item.url).join(',');
    },
    comCertificatePerHandleRemove(file, farenFileList) {
      // 文件移除时的回调
      const index = this.comCertificatePerFile.findIndex(item => item.url === file.url);
      if (index !== -1) {
        this.comCertificatePerFile.splice(index, 1);
      }
      this.form.comCertificatePer = this.comCertificatePerFile.map(item => item.url).join(',');
    },
    comCertificatePerBeforeUpload(file) {
      // 在上传前的钩子，可以在这里添加一些判断逻辑
      // 返回 false 可取消上传
      return true;
    },


    comCertificateEmbHandleSuccess(response, file, farenFileList) {
      // 上传成功的回调
      this.comCertificateEmbFile.push({url: response.data});

      this.form.comCertificateEmb = this.comCertificateEmbFile.map(item => item.url).join(',');
    },
    comCertificateEmbHandleRemove(file, farenFileList) {
      // 文件移除时的回调
      const index = this.comCertificateEmbFile.findIndex(item => item.url === file.url);
      if (index !== -1) {
        this.comCertificateEmbFile.splice(index, 1);
      }
      this.form.comCertificateEmb = this.comCertificateEmbFile.map(item => item.url).join(',');
    },
    comCertificateEmbeBeforeUpload(file) {
      // 在上传前的钩子，可以在这里添加一些判断逻辑
      // 返回 false 可取消上传
      return true;
    },


    businessLicenseHandleSuccess(response, file, farenFileList) {
      // 上传成功的回调
      this.businessLicenseFile.push({url: response.data});

      this.form.businessLicense = this.businessLicenseFile.map(item => item.url).join(',');
    },
    businessLicenseHandleRemove(file, farenFileList) {
      // 文件移除时的回调
      const index = this.businessLicenseFile.findIndex(item => item.url === file.url);
      if (index !== -1) {
        this.businessLicenseFile.splice(index, 1);
      }
      this.form.businessLicense = this.businessLicenseFile.map(item => item.url).join(',');
    },
    businessLicenseBeforeUpload(file) {
      // 在上传前的钩子，可以在这里添加一些判断逻辑
      // 返回 false 可取消上传
      return true;
    },


    moreCertificateHandleSuccess(response, file, farenFileList) {
      // 上传成功的回调
      this.moreCertificateFile.push({url: response.data});

      this.form.moreCertificate = this.moreCertificateFile.map(item => item.url).join(',');
    },
    moreCertificateHandleRemove(file, farenFileList) {
      // 文件移除时的回调
      const index = this.moreCertificateFile.findIndex(item => item.url === file.url);
      if (index !== -1) {
        this.moreCertificateFile.splice(index, 1);
      }
      this.form.moreCertificate = this.moreCertificateFile.map(item => item.url).join(',');
    },
    moreCertificateBeforeUpload(file) {
      // 在上传前的钩子，可以在这里添加一些判断逻辑
      // 返回 false 可取消上传
      return true;
    },

    certificatePerHandleSuccess(response, file, farenFileList) {
      // 上传成功的回调
      this.certificatePerFile.push({url: response.data});

      this.form.certificatePer = this.certificatePerFile.map(item => item.url).join(',');
    },
    certificatePerHandleRemove(file, farenFileList) {
      // 文件移除时的回调
      const index = this.certificatePerFile.findIndex(item => item.url === file.url);
      if (index !== -1) {
        this.certificatePerFile.splice(index, 1);
      }
      this.form.certificatePer = this.certificatePerFile.map(item => item.url).join(',');
    },
    certificatePerBeforeUpload(file) {
      // 在上传前的钩子，可以在这里添加一些判断逻辑
      // 返回 false 可取消上传
      return true;
    },

    certificateTwoHandleSuccess(response, file, farenFileList) {
      // 上传成功的回调
      this.certificateTwoFile.push({url: response.data});

      this.form.certificateTwo = this.certificateTwoFile.map(item => item.url).join(',');
    },
    certificateTwoHandleRemove(file, farenFileList) {
      // 文件移除时的回调
      const index = this.certificateTwoFile.findIndex(item => item.url === file.url);
      if (index !== -1) {
        this.certificateTwoFile.splice(index, 1);
      }
      this.form.certificateTwo = this.certificateTwoFile.map(item => item.url).join(',');
    },
    certificateTwoBeforeUpload(file) {
      // 在上传前的钩子，可以在这里添加一些判断逻辑
      // 返回 false 可取消上传
      return true;
    },
    getImgOpenPage(obj) {
      var url = obj;
      window.open(url);
    },
    getStatusColor(state) {
      // 根据状态值动态返回颜色
      return state == 0 ? 'red' : 'green';
    },
    getList() {
      this.loading = true;
      listCustomer(addDateRange2(this.queryParams, this.dateRange, this.dateRange2)).then(response => {
        this.manageList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
      getServiceStatusSelect('REGISTER_CUSTOMERS_STATUS').then(response => {
        this.serviceStatusListSelectOptions = response.data;
      });
      getServiceStatusSelect('REGISTER_CUSTOMERS_AUD_NATIONAL').then(response => {
        this.registrationRegionIdSelectOptions = response.data;
      });
      getServiceStatusSelect('REGISTER_CUSTOMERS_AUD_CUSTOMER_TYPE').then(response => {
        this.registerCustomerTypeIdSelectOptions = response.data;
      });
      getServiceStatusSelect('REGISTER_CUSTOMERS_CERTIFICATE_TYPE_MAINLAND').then(response => {
        this.certificateTypeIdMainLandSelectOptions = response.data;
      });
      getServiceStatusSelect('REGISTER_CUSTOMERS_CERTIFICATE_TYPE_COM').then(response => {
        this.comCertificateTypeIdSelectOptions = response.data;
        this.shareholderTypeOneIdSelectOptions = response.data;
        this.shareholderTypeTwoIdSelectOptions = response.data;
        this.shareholderTypeThreeIdSelectOptions = response.data;
        this.agentTypeIdSelectOptions = response.data;
      });
      getServiceStatusSelect('REGISTER_CUSTOMERS_CERTIFICATE_TYPE_PROVE_TYPE').then(response => {
        this.proveTypeIdSelectOptions = response.data;
      });
      //id下拉
      getRegisterCustomerRegisterId().then(response => {
        this.registerIdSelectOptions = response.data;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        name: undefined,
        phone: '',
        email: '',
        statusName: '',
        certificateNumber: '',
        passportNumber: '',
        address: '',
        creditCode: '',
        enterpriseName: '',
        enterpriseType: '',
        legalRepresentative: '',
        registeredCapital: '',
        businessAddress: '',
        businessScope: '',
        legalName: '',
        legalNumber: '',
        legalPassportNumber: '',
        legalAddress: '',
        shareholderNameOne: '',
        shareholderNumberOne: '',
        shareholderNameTwo: '',
        shareholderNumberTwo: '',
        shareholderNameThree: '',
        shareholderNumberThree: '',
        proveNumber: '',
        agentName: '',
        agentNumber: '',
        certificateStart: '',
        certificateEnd: '',
        birthtime: '',
        incorporationTime: '',
        businessTermStart: '',
        businessTermEnd: '',
        legalCertificateStart: '',
        legalCertificateEnd: '',
        legalBirthTime: '',
        registrationTime: '',
        agentStart: '',
        agentEnd: '',
      };
      // this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      //清空日历控件
      this.dateRange = [];
      this.dateRange2 = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length != 1
      this.multiple = !selection.length
    },
    formatDate(date) {
      const year = date.getFullYear();
      const month = String(date.getMonth() + 1).padStart(2, '0'); // Months are 0-based
      const day = String(date.getDate()).padStart(2, '0');
      const hours = String(date.getHours()).padStart(2, '0');
      const minutes = String(date.getMinutes()).padStart(2, '0');
      const seconds = String(date.getSeconds()).padStart(2, '0');
      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.modifyMessage = "其他";
      this.showAddOrUpdateView = true;
      this.showDetailView = false;
      // getUnique().then(response => {
      //   this.form.registerId = response;
      this.open = true;
      this.title = "添加";
      this.registerId = null;
      //所有图片清空
      this.certificatePerFile = [];
      this.certificateTwoFile = [];
      this.moreCertificateFile = [];
      this.businessLicenseFile = [];
      this.comCertificatePerFile = [];
      this.comCertificateEmbFile = [];
      this.proveImageFile = [];
      this.agentPerFile = [];
      this.agentEmbFile = [];
      this.authorizationFile = [];
      //所有下拉清空
      //除了客户类型，其他下拉均清空
      this.certificateType = [];
      this.registrationRegion = [];
      this.comCertificateType = [];
      this.shareholderTypeOne = [];
      this.shareholderTypeTwo = [];
      this.shareholderTypeThree = [];
      this.proveType = [];
      this.agentType = [];
      //客户类型 默认选中个人
      const registerCustomerType = this.registerCustomerTypeIdSelectOptions.find(option => option.code == '1');
      if (registerCustomerType) {
        this.registerCustomerType = registerCustomerType;
      }


      //添加则不显示创建人创建时间跟修改信息
      this.showBtn = true;
      this.showModifyTime = false;
      this.showModifyByName = false;
      this.showModifyDescription = false;
      this.showModifyMsg = false;
      this.showCreateTime = false;
      this.showCreateByName = true;
    },
    /** 修改按钮操作 */
    handleUpdate(row, status) {
      this.modifyMessage = "变更";
      this.showModifyMsg = true;
      this.showCreateTime = true;
      this.showCreateByName = false;
      this.showModifyDescription = true;
      this.certificatePerFile = [];
      this.certificateTwoFile = [];
      this.isWatching = false;
      if (status == 'edit') {
        //修改人和修改时间隐藏
        this.showBtn = true;
        this.showModifyTime = false;
        this.showModifyByName = false;
        this.showAddOrUpdateView = true;
        this.showDetailView = false;
      } else if (status == 'detail') {
        //全显示且保存隐藏
        this.showAddOrUpdateView = false;
        this.showDetailView = true;
        this.showBtn = false;
        this.showModifyTime = true;
        this.showModifyByName = true;
      }
      this.reset();
      const id = row.id || this.ids
      getCustomer(id).then(response => {
        this.form = response.data;
        this.formView = response.data;
        this.open = true;
        this.title = "修改";
        //图片回显

        //人像页
        if (response.data.certificatePer) {
          const certificatePerArr = response.data.certificatePer.split(",");
          this.certificatePerFile = certificatePerArr.map((url, index) => ({
            name: `file${index + 1}`,
            url: url,
            uid: index + 1,  // 设置一个唯一的 uid
          }));
        } else {
          this.certificatePerFile = [];
        }

        //国徽页/手持证件照
        if (response.data.certificateTwo) {
          const certificateTwoArr = response.data.certificateTwo.split(",");
          this.certificateTwoFile = certificateTwoArr.map((url, index) => ({
            name: `file${index + 1}`,
            url: url,
            uid: index + 1,  // 设置一个唯一的 uid
          }));
        } else {
          this.certificateTwoFile = [];
        }

        if (response.data.moreCertificate) {
          const moreCertificateArr = response.data.moreCertificate.split(",");
          this.moreCertificateFile = moreCertificateArr.map((url, index) => ({
            name: `file${index + 1}`,
            url: url,
            uid: index + 1,  // 设置一个唯一的 uid
          }));
        } else {
          this.moreCertificateFile = [];
        }

        //企业图片回显
        if (response.data.businessLicense) {
          const businessLicenseArr = response.data.businessLicense.split(",");
          this.businessLicenseFile = businessLicenseArr.map((url, index) => ({
            name: `file${index + 1}`,
            url: url,
            uid: index + 1,  // 设置一个唯一的 uid
          }));
        } else {
          this.businessLicenseFile = [];
        }

        if (response.data.comCertificatePer) {
          const comCertificatePerArr = response.data.comCertificatePer.split(",");
          this.comCertificatePerFile = comCertificatePerArr.map((url, index) => ({
            name: `file${index + 1}`,
            url: url,
            uid: index + 1,  // 设置一个唯一的 uid
          }));
        } else {
          this.comCertificatePerFile = [];
        }

        if (response.data.comCertificateEmb) {
          const comCertificateEmbArr = response.data.comCertificateEmb.split(",");
          this.comCertificateEmbFile = comCertificateEmbArr.map((url, index) => ({
            name: `file${index + 1}`,
            url: url,
            uid: index + 1,  // 设置一个唯一的 uid
          }));
        } else {
          this.comCertificateEmbFile = [];
        }

        if (response.data.proveImage) {
          const proveImageArr = response.data.proveImage.split(",");
          this.proveImageFile = proveImageArr.map((url, index) => ({
            name: `file${index + 1}`,
            url: url,
            uid: index + 1,  // 设置一个唯一的 uid
          }));
        } else {
          this.proveImageFile = [];
        }

        if (response.data.agentPer) {
          const agentPerArr = response.data.agentPer.split(",");
          this.agentPerFile = agentPerArr.map((url, index) => ({
            name: `file${index + 1}`,
            url: url,
            uid: index + 1,  // 设置一个唯一的 uid
          }));
        } else {
          this.agentPerFile = [];
        }

        if (response.data.agentEmb) {
          const agentEmbArr = response.data.agentEmb.split(",");
          this.agentEmbFile = agentEmbArr.map((url, index) => ({
            name: `file${index + 1}`,
            url: url,
            uid: index + 1,  // 设置一个唯一的 uid
          }));
        } else {
          this.agentEmbFile = [];
        }

        if (response.data.authorizationFile) {
          const authorizationFileArr = response.data.authorizationFile.split(",");
          this.authorizationFile = authorizationFileArr.map((url, index) => {
            return {
              name: url.split('/').pop(),
              url: url.trim(), // 去除 URL 前后可能存在的空格
              uid: index + 1,  // 设置一个唯一的 uid
            };
          });
        } else {
          this.authorizationFile = [];
        }

        //下拉回显
        //TODO 下拉等填充值
        const registerId = this.registerIdSelectOptions.find(option => option.code == response.data.auditingId);
        if (registerId) {
          this.registerId = registerId;
        }
        //个人
        const registerCustomerType = this.registerCustomerTypeIdSelectOptions.find(option => option.code == response.data.customerType);
        if (registerCustomerType) {
          this.registerCustomerType = registerCustomerType;
        }
        this.isWatching = false;
        const registrationRegion = this.registrationRegionIdSelectOptions.find(option => option.code == response.data.registrationRegion);
        if (registrationRegion) {
          this.registrationRegion = registrationRegion;
        }
        const certificateType = this.certificateTypeIdMainLandSelectOptions.find(option => option.code == response.data.certificateType);
        if (certificateType) {
          this.certificateType = certificateType;
        }
        //企业
        const comCertificateType = this.comCertificateTypeIdSelectOptions.find(option => option.code == response.data.comCertificateType);
        if (comCertificateType) {
          this.comCertificateType = comCertificateType;
        }
        const shareholderTypeOne = this.shareholderTypeOneIdSelectOptions.find(option => option.code == response.data.shareholderTypeOne);
        if (shareholderTypeOne) {
          this.shareholderTypeOne = shareholderTypeOne;
        }
        const shareholderTypeTwo = this.shareholderTypeTwoIdSelectOptions.find(option => option.code == response.data.shareholderTypeTwo);
        if (shareholderTypeTwo) {
          this.shareholderTypeTwo = shareholderTypeTwo;
        }
        const shareholderTypeThree = this.shareholderTypeThreeIdSelectOptions.find(option => option.code == response.data.shareholderTypeThree);
        if (shareholderTypeThree) {
          this.shareholderTypeThree = shareholderTypeThree;
        }
        const proveType = this.proveTypeIdSelectOptions.find(option => option.code == response.data.proveType);
        if (proveType) {
          this.proveType = proveType;
        }
        const agentType = this.agentTypeIdSelectOptions.find(option => option.code == response.data.agentType);
        if (agentType) {
          this.agentType = agentType;
        }


        this.form.phone = response.data.phone;
        this.form.email = response.data.email;
        this.form.statusName = response.data.statusName;

        setTimeout(() => {
          this.isWatching = true;
        }, 500);
      });
    },
    /** 提交按钮 */
    submitForm: function () {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.registerId != null && this.registerId.code != null) {
            this.form.auditingId = this.registerId.code;
          } else {
            this.$message.error(`请选择id!`);
            return;
          }

          if (this.registrationRegion && this.registrationRegion.code) {
            this.form.registrationRegion = this.registrationRegion.code;
          } else {
            this.$message.error(`请选择注册地区!`);
            return;
          }

          if (this.registerCustomerType != null && this.registerCustomerType.code != null) {
            this.form.customerType = this.registerCustomerType.code;
            if (this.registerCustomerType.code == '0' || this.registerCustomerType.code == 0) {
              //0企业，1个人
              if (this.comCertificateType && this.comCertificateType.code) {
                this.form.comCertificateType = this.comCertificateType.code;
              }
              if (this.shareholderTypeOne && this.shareholderTypeOne.code) {
                this.form.shareholderTypeOne = this.shareholderTypeOne.code;
              }
              if (this.shareholderTypeTwo && this.shareholderTypeTwo.code) {
                this.form.shareholderTypeTwo = this.shareholderTypeTwo.code;
              }
              if (this.shareholderTypeThree && this.shareholderTypeThree.code) {
                this.form.shareholderTypeThree = this.shareholderTypeThree.code;
              }
              if (this.proveType && this.proveType.code) {
                this.form.proveType = this.proveType.code;
              }
              if (this.agentType && this.agentType.code) {
                this.form.agentType = this.agentType.code;
              }
            } else {
              if (this.certificateType && this.certificateType.code) {
                this.form.certificateType = this.certificateType.code;
              }
            }

          } else {
            this.$message.error(`请选择客户类型!`);
            return;
          }
          if (this.form.id != undefined) {
            updateCustomer(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addCustomer(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const id = row.id || this.ids
      this.$modal.confirm('是否确认删除编号为"' + id + '"的数据项？').then(function () {
        return delProviders(id);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      });
    }
  }
};
</script>
<style>
.my-dropdown .el-popper {
  /* 控制下拉框的弹出方向 */
  /* 例如，下拉框向上弹出 */
  top: -50px !important;
  bottom: 100% !important;
}

.image-container {
  text-align: left;
}

.image-item {
  display: inline-block; /* 设置为行内块元素 */
  width: 33.33%; /* 每行最多显示三张图片 */
  margin-bottom: 10px; /* 图片之间的间距 */
}

</style>
